package week2.validator_ex;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class AuthenticatorFactory {
    public static Authenticator createAuthenticator() {
    createKeyValueKeeper keeper =createKeyValueKeeper();
    Encrypter encrypter = createEncrypter();
 return  new Authenticator(keeper,encrypter);
    }

    private static KeyValueKeeper createKeyValueKeeper(){
        KeyVauleKeeper keeper=null;
        try{
            keeper=(KeyVauleKeeper).Class.forName(prop.getProperty("KeyVauleKeeper")).newInstance();
        }catch (Exception e){
            e.printStackTrace();

        }
    }


    private static Encrypter createEncrypter() {
        Encryter encryter =null;
        try{
            keeper=(Encryter).Class.forName(prop.getProperty("Encryter")).newInstance();
        }catch (Exception e){
            e.printStackTrace();

        }
    }